package com.hub.controller;

import com.hub.dto.SearchUserModel;
import com.hub.frame.annotation.RestAuth;
import com.hub.service.IUserService;
import com.hub.utils.ApiResultObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author hub
 */
@Slf4j
@Api(value="用户登录")
@RestController
@RequestMapping(value="")
public class UserController extends BaseController{
    @Autowired
    private IUserService userService;

    @RestAuth(isPublic = true)
    @ApiOperation(value="登录")
    @PostMapping(value="/login")
    public ApiResultObject doLogin(@RequestBody SearchUserModel model){

        return this.userService.doLogin(model);
    }
}
